
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>2.环境准备 · GitBook电子书</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="吴俭">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../chapter3/" />
    
    
    <link rel="prev" href="../" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    1.介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2" data-path="./">
            
                <a href="./">
            
                    
                    2.环境准备
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../chapter3/">
            
                <a href="../chapter3/">
            
                    
                    3.基本使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../chapter4/">
            
                <a href="../chapter4/">
            
                    
                    4.插件运用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../chapter5/">
            
                <a href="../chapter5/">
            
                    
                    5.服务部署
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >2.环境准备</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x914D;&#x7F6E;nodejs&#x73AF;&#x5883;">&#x914D;&#x7F6E;<code>Node.js</code>&#x73AF;&#x5883;</h1>
<p>&#x4F7F;&#x7528;<code>GitBook</code>&#x9700;&#x8981;&#x914D;&#x7F6E;<code>Node.js</code>&#x73AF;&#x5883;&#xFF0C;&#x5177;&#x4F53;&#x7684;&#x5B89;&#x88C5;&#x6B65;&#x9AA4;&#xFF0C;&#x53EF;&#x67E5;&#x770B;<a href="https://nodejs.org/zh-cn/download/" target="_blank">&#x5B98;&#x65B9;&#x6587;&#x6863;</a>&#x3002;</p>
<p>&#x5B89;&#x88C5;&#x6210;&#x529F;&#x540E;&#xFF0C;&#x6267;&#x884C;&#x547D;&#x4EE4;&#x53EF;&#x67E5;&#x770B;<code>node</code> &#x7248;&#x672C;&#x548C;<code>npm</code>&#x7248;&#x672C;&#x3002;</p>
<pre><code class="lang-shell">&#x67E5;&#x770B;node&#x7248;&#x672C;
node -v
#&#x67E5;&#x770B;npm&#x7248;&#x672C;
npm -v
</code></pre>
<h1 id="&#x5B89;&#x88C5;-gitbook">&#x5B89;&#x88C5; Gitbook</h1>
<p>&#x4F7F;&#x7528;&#x4E0B;&#x9762;&#x547D;&#x4EE4;&#xFF0C;&#x5B89;&#x88C5;<code>GitBook</code> &#x5305;&#x3002;</p>
<pre><code class="lang-shell">npm install -g gitbook-cli
</code></pre>
<p>&#x53EF;&#x4EE5;&#x5728;<a href="https://www.npmjs.com/package/gitbook" target="_blank"><code>npm</code>&#x5B98;&#x7F51;</a>&#x641C;&#x7D22;<code>GitBook</code>&#x83B7;&#x53D6;&#x5177;&#x4F53;&#x5B89;&#x88C5;&#x6B65;&#x9AA4;&#x3002;</p>
<p>&#x5B89;&#x88C5;&#x5B8C;&#x6210;&#x4E4B;&#x540E;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x4E0B;&#x9762;&#x7684;&#x547D;&#x4EE4;&#x6765;&#x68C0;&#x9A8C;&#x662F;&#x5426;&#x5B89;&#x88C5;&#x6210;&#x529F;&#x3002;</p>
<pre><code class="lang-shell">gitbook -V
</code></pre>
<h1 id="&#x5E38;&#x7528;&#x547D;&#x4EE4;">&#x5E38;&#x7528;&#x547D;&#x4EE4;</h1>
<pre><code class="lang-shell"># &#x5378;&#x8F7D;&#x6307;&#x5B9A;&#x7248;&#x672C;&#x53F7;&#x7684;gitbook
gitbook uninstall [version]

# &#x5217;&#x51FA;NPM&#x4E0A;&#x7684;&#x53EF;&#x7528;&#x7248;&#x672C;
gitbook ls-remote

# &#x83B7;&#x53D6;[&#x7248;&#x672C;]&#x4E0B;&#x8F7D;&#x5E76;&#x5B89;&#x88C5;&lt;&#x7248;&#x672C;&gt;
gitbook fetch [version]
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../" class="navigation navigation-prev " aria-label="Previous page: 1.介绍">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../chapter3/" class="navigation navigation-next " aria-label="Next page: 3.基本使用">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"2.环境准备","level":"1.2","depth":1,"next":{"title":"3.基本使用","level":"1.3","depth":1,"path":"chapter3/README.md","ref":"chapter3/README.md","articles":[]},"previous":{"title":"1.介绍","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-sharing","-search","search-pro","code","expandable-chapters","back-to-top-button","splitter","hide-element"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"splitter":{},"search-pro":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"code":{"copyButtons":true},"hide-element":{"elements":[".gitbook-link"]},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"back-to-top-button":{},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{}},"theme":"default","author":"吴俭","lang":"zh-cn","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"GitBook电子书","gitbook":"*","description":"GitBook电子书"},"file":{"path":"chapter2/README.md","mtime":"2021-12-11T14:45:02.096Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-12-11T15:38:57.245Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-hide-element/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

